cmake_minimum_required(VERSION 3.10...3.21)

project(logger)

add_definitions(-DSPDLOG_ACTIVE_LEVEL=0x00) #开启spdlog宏打印的trace debug等级

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_BUILD_TYPE Release)

include_directories(
        ./include
        ./include/cJSON
)

file(GLOB LOGGER_FILES
        ./src/*.cpp
        ./src/*.c
        )

add_library(${PROJECT_NAME} SHARED ${LOGGER_FILES})
#add_library(${PROJECT_NAME} STATIC ${LOGGER_FILES})

target_link_libraries(${PROJECT_NAME}
        pthread
        )

install(TARGETS ${PROJECT_NAME}
        DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include
        DESTINATION ${CMAKE_INSTALL_PREFIX}
        FILES_MATCHING PATTERN "*.h"
)

